<!DOCTYPE html>
<html>

<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="../bootstrap-5.1.3-dist/css/bootstrap.css" rel="stylesheet">
    <script src="../bootstrap-5.1.3-dist/js/bootstrap.bundle.min.js"></script>
</head>

<body class="container">
    <h2 align="center">使用CSS样式来控制卡片的宽度</h2>
    <div class="card mb-3" style="width: 15rem">
        <div class="card-body">卡片主体的宽度（15rem）</div>
    </div>
    <div class="card mb-3" style="width: 20rem">
        <div class="card-body">卡片主体的宽度（20rem）</div>
    </div>
    <div class="card" style="width: 40rem">
        <div class="card-body">卡片主体的宽度（40rem）</div>
    </div>

</body>

</html>